package cn.jhc.teachingquality.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import cn.jhc.teachingquality.activity.MainActivity;
import cn.jhc.teachingquality.fragment.PracticeLogListFragment;
import cn.jhc.teachingquality.fragment.TeachingLogListFragment;

/**
 * Created by luyanfei on 16-3-24.
 */
public class TeachingPagerAdapter extends FragmentPagerAdapter{

    public TeachingPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position){
            case 1:
                PracticeLogListFragment practiceLogListFragment = new PracticeLogListFragment();
                return practiceLogListFragment;
            case 0:
                TeachingLogListFragment teachingLogListFragment = new TeachingLogListFragment();
                return teachingLogListFragment;
            default:
                return null;
        }
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position){
            case 1:
                return "实习日志";
            case 0:
                return "教学日志";
            default:
                return "";
        }
    }
}
